import { JsonUtil } from "db://app-game/core/utils/JsonUtil";
import { DBStaticCreatureType } from "./DBStaticCreature.type";

/** 静态生物数据表 */
export class DBStaticCreature {
  /** 表单名称 */
  static DBName = "StaticCreature";
  /** 表单数据 */
  data: DBStaticCreatureType = null!;

  init(id: number) {
    let db = JsonUtil.get(DBStaticCreature.DBName) as DBStaticCreatureType[];
    this.data = db.find((v) => v.id === Number(id))!;
  }
}
